<!--
* 方法:Admin.vue
* 描述:系统用户
* 作者:Jimmy
* 日期:2018-08-04
*/
-->
<template>
  <div>
    <AdminList v-show="list" @toggle="show"></AdminList>
    <AdminInfo v-show="info" @toggle="show" v-bind:data="data" v-if="info"></AdminInfo>
  </div>
</template>
<script>
import AdminList from './components/Admin-list.vue'
import AdminInfo from './components/Admin-info.vue'
export default {
  components: {
    AdminList,
    AdminInfo
  },
  data () {
    return {
      list: true,
      info: false,
      data: ''
    }
  },
  methods: {
    show (data) {
      if (data.type === 'list') {
        this.list = true
        this.info = false
      } else {
        this.$nextTick()
        this.list = false
        this.info = true
        this.data = data
      }
    }
  }
}
</script>
